import request from '#/utils/requestAbort.js';

// 任务列表查询（分页）
export async function taskTableData(params) {
  return request('/task-management/task/taskList', {
    method: 'POST',
    data: params,
  });
}
// 删除任务
export async function deleteTask(taskId) {
  return request(`/task-management/task/deleteTask/${taskId}`, {
    method: 'GET',
  });
}
// 新增任务
export async function addTask(params) {
  return request('/task-management/task/addTask', {
    method: 'POST',
    data: params,
  });
}
// 任务部署
export async function deployTask(taskId) {
  return request(`/task-management/task/deployTask/${taskId}`, {
    method: 'GET',
  });
}
// 取消部署
export async function undeploy(taskId) {
  return request(`/task-management/task/undeploy/${taskId}`, {
    method: 'GET',
  });
}
// 任务详情
export async function taskDetail(taskId) {
  return request(`/task-management/task/taskDetail/${taskId}`, {
    method: 'GET',
  });
}
// 任务编辑
export async function updateTask(params) {
  return request(`/task-management/task/updateTask`, {
    method: 'POST',
    data: params,
  });
}
// 任务实例
export async function taskInstanceList(params) {
  return request('/task-management/taskInstance/taskInstanceList', {
    method: 'POST',
    data: params,
  });
}
// 任务实例详情
export async function taskInstanceDetail(id) {
  return request(`/task-management/taskInstance/taskInstanceDetail/${id}`, {
    method: 'GET',
  });
}
